package com.googlecode.kipler.container.dl.creational;

import com.googlecode.kipler.container.dl.WorldConstraintSystem;
import com.googlecode.kipler.satisfiability.reasoner.Reasoner;

/**
 * 
 * @author İnanç Seylan
 * 
 */
public abstract class WcsFactory {
	private boolean unfoldableTBox = true;

	private Reasoner reasoner;

	public abstract WorldConstraintSystem createWcs();

	public WcsFactory(boolean unfoldableTBox) {
		this.unfoldableTBox = unfoldableTBox;
	}

	public boolean isUnfoldableTBox() {
		return unfoldableTBox;
	}

	public void setReasoner(Reasoner reasoner) {
		this.reasoner = reasoner;
	}

	public Reasoner getReasoner() {
		return reasoner;
	}

	public static WcsFactory getFactory(ContainerType type,
			boolean unfoldableTBox, Reasoner reasoner) {
		WcsFactory result = null;
		switch (type) {
		case ALC:
			result = new ALCWcsFactory(unfoldableTBox);
			break;
		case LTLALC:
			result = new LTLALCWcsFactory(unfoldableTBox);
			break;
		case SHQ:
			result = new SHQWcsFactory(unfoldableTBox);
			break;
		case SHIQ_BASIC:
			result = new SHIQBasicWcsFactory(unfoldableTBox);
			break;
		case SHIQ_MODIFIED_INDIVIDUAL:
			result = new SHIQModifiedIndividualListWcsFactory(unfoldableTBox);
			break;
		case SHOIQ_BASIC:
			result = new SHOIQBasicWcsFactory(unfoldableTBox);
			break;
		case SHOIQ_MODIFIED_INDIVIDUAL:
			result = new SHOIQModifiedIndividualListWcsFactory(unfoldableTBox);
			break;
		}
		result.setReasoner(reasoner);
		return result;
	}
}
